package service.impl;

import dao.IEmpDao;
import dao.impl.EmpDaoImpl;
import pojo.Emp;
import service.IEmpService;

import java.util.ArrayList;

public class EmpServiceImpl implements IEmpService {

    private IEmpDao ied=new EmpDaoImpl();
    @Override
    public Emp Login(Emp emp) {
        ArrayList<Emp> emps=ied.selectByEmpnoAndEname(emp);
        if (emps.size()>0){
            return emps.get(0);
        }else {
            return null;
        }

    }

    @Override
    public ArrayList<Emp> queryAll() {
        return ied.selectAll();
    }

    @Override
    public boolean removeByEmpno(int empno) {
        return ied.delByEmpno(empno)>0?true:false;
    }
}
